package cn.yangliu.service.impl;

import cn.yangliu.entity.Cache;
import cn.yangliu.jpa.base.service.impl.JpaServiceImpl;
import cn.yangliu.repository.CacheRepository;
import cn.yangliu.service.CacheService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 问道于盲
 * @date 2021-10-03
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class CacheServiceImpl extends JpaServiceImpl<Cache, Long, CacheRepository> implements CacheService {

    /**
     * 根据key查询缓存
     *
     * @param key key
     * @return 缓存
     */
    @Override
    public Cache findByKey (String key) {
        return repository.findByKey(key);
    }
}
